home *** CD-ROM | disk | FTP | other *** search
- global gPathDel
-
- on findpath
- if the machineType = 256 then
- openXLib("FileIO.DLL")
- repeat with i = 67 to 90
- set driveLetter to numToChar(i)
- if getNthFileNameInFolder(driveLetter & ":\Achk", 1) = "ayad.txt" then
- return driveLetter & ":\"
- end if
- end repeat
- return EMPTY
- else
- set macCdName to "DarkNight"
- set baseCD to macCdName & gPathDel
- set testPath to baseCD & "achk:ayad.txt"
- if checkIfFileExist(testPath) then
- return baseCD
- else
- return EMPTY
- end if
- end if
- end
-
- on checkIfFileExist fileName
- set gMyFile to new(xtra("fileio"))
- openFile(gMyFile, fileName, 1)
- set theStat to status(gMyFile)
- set theError to error(gMyFile, theStat)
- if theStat <> 0 then
- set theAnswer to 0
- else
- set theAnswer to 1
- closeFile(gMyFile)
- end if
- set gMyFile to 0
- return theAnswer
- end
-